import request from '@/utils/request'

// 获取角色列表接口
export const getRoleList = (params) => request({
  url: '/sys/role',
  params
})

// 新增角色接口
export const addRole = data => request({
  url: '/sys/role',
  method: 'POST',
  data
})

// 获取角色详情接口
export const getRole = id => request({
  url: `/sys/role/${id}`
})

// 修改角色接口
export const updateRole = (id, data) => request({
  url: `/sys/role/${id}`,
  method: 'PUT',
  data
})

// 删除角色接口
export const removeRole = id => request({
  url: `/sys/role/${id}`,
  method: 'DELETE'
})
// 获取已启用的角色列表
export const trueRoleList = () => request({
  url:'/sys/role/list/enabled',
})

// 分配权限
export const assginPermission = data => request({
  url: '/sys/role/assignPrem',
  method: 'PUT',
  data
})